---------------------------------------------------------------------------------------------------------------------------------
      name:  plog_1
       log:  /Users/au660280/Dropbox/m5S/JoP_PlaceBasedCampaigning_replication/PlaceBased_analysis.log
  log type:  text
 opened on:  19 Sep 2022, 11:38:37

. /*
> This is the mastercode file for the replication of: Place-based Campaigning in JoP
> 
> HELP:
> - you need to install "project" in stata: ssc install project 
> - after that you type: project, setup and select this master file
> project , setmaster("folder") textlog
> - then you can rebuild the entire analyses by typing: project xyz, build
> 
> 
> */ 
. 
. *Stata MP Version 17.0 // in case Stata's syntax changes in future versions
. 
. * directory definitions 
. 
.         project, doinfo
project PlaceBased_analysis > Project Name: PlaceBased_analysis
project PlaceBased_analysis > Project Dir.: /Users/au660280/Dropbox/m5S/JoP_PlaceBasedCampaigning_replication
project PlaceBased_analysis > Build start : 19sep2022, 11:38:37
project PlaceBased_analysis > Do-file Name: PlaceBased_analysis.do

.         global pdir "`r(pdir)'"                                                 // the project's main dir.

.         global dofile "`r(dofile)'"                                             // do-file's stub name

.         global data_original = "$pdir/data_original"  //data directory for coded data 

.         global data_coded = "$pdir/data_coded"  //data directory for coded data 

.         global figures = "$pdir/results/figures"  //data directory for figures

.         global tables = "$pdir/results/tables"  //data directory for tables

. 
. * Common settings
. 
.         set more off

.         set varabbrev off  // less confusing

.         set linesize 132   // use 7pt font for printing

. 
. * packages to install: 
. foreach package in CODEBOOKOUT spmap ebalance shp2dta mif2dta egen fre coefplot gsort ivreghdfe reghdfe ranktest erepost tuples re
> nvars revrs regsave project psmatch2 freqindex estout ivregress ivreg2 putexcel{
  2.       capture which `package'
  3.       if _rc==111 ssc install `package'
  4. }

. 
. * Sometimes issues with FE of reghdfe. Then use: 
.     reghdfe, compile
(compiling lreghdfe.mlib for Stata 17)
(library saved in /Users/au660280/Library/Application Support/Stata/ado/plus/l/lreghdfe.mlib)

. 
. * Run do-files
. 
.     cls

. *
.     //prepare the regional level data:
.     project, do(code/do/05_prepare_regional.do)
project PlaceBased_analysis > do-file uses original: "code/do/05_prepare_regional.do" filesig(1147010680:18785)
project PlaceBased_analysis > do-file creates: "code/do/05_prepare_regional.log" filesig(1043976429:41404)

. 
. *
.     //prepare the individual level data:
.     project, do(code/do/06_prepare_individual.do)
project PlaceBased_analysis > do-file uses original: "code/do/06_prepare_individual.do" filesig(310094807:16502)
project PlaceBased_analysis > do-file creates: "code/do/06_prepare_individual.log" filesig(828054696:38512)

. 
. *
.     //prepare shapefile and data for maps:
.     project, do(code/do/07_prepare_maps.do)
project PlaceBased_analysis > do-file uses original: "code/do/07_prepare_maps.do" filesig(1964298376:2541)
project PlaceBased_analysis > do-file creates: "code/do/07_prepare_maps.log" filesig(3223710624:14944)

. 
. *
.     //prepare ITANES 1996 for independence tests:
.     project, do(code/do/08_prepare_independence.do)
project PlaceBased_analysis > do-file uses original: "code/do/08_prepare_independence.do" filesig(4002495113:5856)
project PlaceBased_analysis > do-file creates: "code/do/08_prepare_independence.log" filesig(4249091599:17846)

. 
. *
.     //analyze the regional level data:
.     project, do(code/do/09_analysis_regional.do)
project PlaceBased_analysis > do-file uses original: "code/do/09_analysis_regional.do" filesig(481219738:29914)
project PlaceBased_analysis > do-file creates: "code/do/09_analysis_regional.log" filesig(1668631470:627198)

. 
. *
.     //analyze the individual level data:
.     project, do(code/do/10_analysis_individual.do)
project PlaceBased_analysis > do-file uses original: "code/do/10_analysis_individual.do" filesig(2913740546:13983)
project PlaceBased_analysis > do-file creates: "code/do/10_analysis_individual.log" filesig(1514945181:188873)

. 
. *
.     //cleanings to ensure that next replication run will be successful:
.     project, do(code/do/11_cleanings.do)
project PlaceBased_analysis > do-file uses original: "code/do/11_cleanings.do" filesig(1400466291:745)
project PlaceBased_analysis > do-file creates: "code/do/11_cleanings.log" filesig(4171110627:1994)

.     
. 
end of do-file
      name:  plog_1
       log:  /Users/au660280/Dropbox/m5S/JoP_PlaceBasedCampaigning_replication/PlaceBased_analysis.log
  log type:  text
 closed on:  19 Sep 2022, 11:40:59
------------------------------------------------------------------------------------------------------------------------------------
